home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / tar.gnu / sprite / RCS / rmt.h,v < prev    next >
Encoding:
Text File  |  1992-03-06  |  3.2 KB  |  117 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     92.03.05.21.39.10;  author rab;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     90.10.27.21.47.01;  author rab;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @*** empty log message ***
  27. @
  28. text
  29. @/* Remote tape drive defines for tar.
  30.    Copyright (C) 1988 Free Software Foundation
  31.  
  32. This file is part of GNU Tar.
  33.  
  34. GNU Tar is free software; you can redistribute it and/or modify
  35. it under the terms of the GNU General Public License as published by
  36. the Free Software Foundation; either version 1, or (at your option)
  37. any later version.
  38.  
  39. GNU Tar is distributed in the hope that it will be useful,
  40. but WITHOUT ANY WARRANTY; without even the implied warranty of
  41. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  42. GNU General Public License for more details.
  43.  
  44. You should have received a copy of the GNU General Public License
  45. along with GNU Tar; see the file COPYING.  If not, write to
  46. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  47.  
  48. #define NO_REMOTE
  49.  
  50. #ifdef NO_REMOTE
  51. #define rmtopen        open
  52. #define rmtaccess    access
  53. #define rmtstat        stat
  54. #define rmtcreat    creat
  55. #define rmtlstat    lstat
  56. #define rmtread        read
  57. #define rmtwrite    write
  58. #define rmtlseek    lseek
  59. #define rmtclose    close
  60. #define rmtioctl    ioctl
  61. #define rmtdup        dup
  62. #define rmtfstat    fstat
  63. #define rmtfcntl    fcntl
  64. #define rmtisatty    isatty
  65.  
  66. extern long lseek();
  67. #else
  68. #ifndef USG
  69. #define strchr index
  70. #endif
  71.  
  72. #define __REM_BIAS    128
  73. #define RMTIOCTL
  74.  
  75. #ifndef O_CREAT
  76. #define O_CREAT    01000
  77. #endif
  78. extern char *__rmt_path;
  79. extern char *strchr();
  80.  
  81. #define _remdev(path)    ((__rmt_path=strchr(path, ':')) && strncmp(__rmt_path, ":/dev/", 6)==0)
  82. #define _isrmt(fd)        ((fd) >= __REM_BIAS)
  83.  
  84. #define rmtopen(path,oflag,mode) (_remdev(path) ? __rmt_open(path, oflag, mode, __REM_BIAS) : open(path, oflag, mode))
  85. #define rmtaccess(path, amode)    (_remdev(path) ? 0 : access(path, amode))
  86. #define rmtstat(path, buf)    (_remdev(path) ? (errno = EOPNOTSUPP), -1 : stat(path, buf))
  87. #define rmtcreat(path, mode)    (_remdev(path) ? __rmt_open (path, 1 | O_CREAT, mode, __REM_BIAS) : creat(path, mode))
  88. #define rmtlstat(path,buf)    (_remdev(path) ? (errno = EOPNOTSUPP), -1 : lstat(path,buf))
  89.  
  90. #define rmtread(fd, buf, n)    (_isrmt(fd) ? __rmt_read(fd - __REM_BIAS, buf, n) : read(fd, buf, n))
  91. #define rmtwrite(fd, buf, n)    (_isrmt(fd) ? __rmt_write(fd - __REM_BIAS, buf, n) : write(fd, buf, n))
  92. #define rmtlseek(fd, off, wh)    (_isrmt(fd) ? __rmt_lseek(fd - __REM_BIAS, off, wh) : lseek(fd, off, wh))
  93. #define rmtclose(fd)        (_isrmt(fd) ? __rmt_close(fd - __REM_BIAS) : close(fd))
  94. #ifdef RMTIOCTL
  95. #define rmtioctl(fd,req,arg)    (_isrmt(fd) ? __rmt_ioctl(fd - __REM_BIAS, req, arg) : ioctl(fd, req, arg))
  96. #else
  97. #define rmtioctl(fd,req,arg)    (_isrmt(fd) ? (errno = EOPNOTSUPP), -1 : ioctl(fd, req, arg))
  98. #endif
  99. #define rmtdup(fd)        (_isrmt(fd) ? (errno = EOPNOTSUPP), -1 : dup(fd))
  100. #define rmtfstat(fd, buf)    (_isrmt(fd) ? (errno = EOPNOTSUPP), -1 : fstat(fd, buf))
  101. #define rmtfcntl(fd,cmd,arg)    (_isrmt(fd) ? (errno = EOPNOTSUPP), -1 : fcntl (fd, cmd, arg))
  102. #define rmtisatty(fd)        (_isrmt(fd) ? 0 : isatty(fd))
  103.  
  104. #undef RMTIOCTL
  105. extern long lseek(),__rmt_lseek();
  106. #endif
  107. @
  108.  
  109.  
  110. 1.1
  111. log
  112. @Initial revision
  113. @
  114. text
  115. @d20 2
  116. @
  117.